import { Dimensions, Text, View } from "react-native";
import { BaseToast, ErrorToast } from "react-native-toast-message";

export const windowWidth = Dimensions.get("window").width;
export const windowHeight = Dimensions.get("window").height;

export const colors = [
  // "#F56E6E",
  // "#F7A363",
  // "#FACB5C",
  // "#65C7FC",
  // "#6B9AFF",
  // "#6272FC",
  // "#826FFC",
  // "#D17DFF",
  // "#CB58FC",
  // "#FF66B5",
  // '#034EB8',
  // '#0563E6',
  // '#217CF9',
  // '#4590F8',
  // '#69A6F9',
  // '#8DBCFB',
  // '#ACCEFD',
  // '#BED8FD',
  // '#D3E5FE',
  // '#E6F4FF',
  '#826FFC','#6272FC','#6B9AFF','#65C7FC','#F7A363','#FACB5C','#DA82FF','#DAA0FA','#FA7D7D','#FF96CC'
];



export const moodsConfig = {
  "0": "未选择",
  "1": "高",
  "2": "中",
  "3": "低",
};

export const moodsColors = {
  "1": "rgba(255, 141, 26, 1)",
  "2": "rgba(67, 207, 124, 1)",
  "3": "rgba(142, 142, 147, 1)",
  "0": "rgba(199, 199, 204, 1)",
};

export const toastConfig = {
  /*
      Overwrite 'success' type,
      by modifying the existing `BaseToast` component
    */
  success: (props) => (
    <BaseToast
      {...props}
      style={{ borderLeftColor: "pink" }}
      contentContainerStyle={{ paddingHorizontal: 15 }}
      text1Style={{
        fontSize: 15,
        fontWeight: "400",
      }}
    />
  ),
  /*
      Overwrite 'error' type,
      by modifying the existing `ErrorToast` component
    */
  error: (props) => (
    <ErrorToast
      {...props}
      text1Style={{
        fontSize: 17,
      }}
      text2Style={{
        fontSize: 15,
      }}
    />
  ),

  info: (props) => (
    <BaseToast
      {...props}
      style={{ width: 194, justifyContent: "center", alignItems: "center" }}
      contentContainerStyle={{
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
        width: "auto",
        backgroundColor: "rgba(0, 0, 0, 0.72)",
        paddingHorizontal: 24,
        paddingVertical: 6,
        borderRadius: 140,
      }}
      text1Style={{
        color: "white",
        fontSize: 12,
        fontWeight: "500",
        fontFamily: "HarmonyOS_Sans_SC_Regular",
      }}
    />
  ),
  /*
      Or create a completely new type - `tomatoToast`,
      building the layout from scratch.
  
      I can consume any custom `props` I want.
      They will be passed when calling the `show` method (see below)
    */
  normal: ({ text1, props }) => (
    <View
      style={{
        display: "flex",
        justifyContent: "center",
        alignItems: "center",
        width: "auto",
        height: 48,
        backgroundColor: "rgba(0, 0, 0, 0.72)",
        paddingHorizontal: 24,
        paddingVertical: 6,
        borderRadius: 140,
      }}
    >
      <Text
        style={{
          color: "white",
          fontSize: 12,
          fontWeight: "500",
          fontFamily: "HarmonyOS_Sans_SC_Regular",
        }}
      >
        {text1}
      </Text>
    </View>
  ),

  modalInfo: (props) => (
    <View
      style={{
        display: "flex",
        justifyContent: "center",
        alignItems: "center",
        width: "auto",
        height: 48,
        backgroundColor: "rgba(0, 0, 0, 0.72)",
        paddingHorizontal: 24,
        paddingVertical: 6,
        borderRadius: 140,
      }}
    >
      <Text
        style={{
          color: "white",
          fontSize: 12,
          fontWeight: "500",
          fontFamily: "HarmonyOS_Sans_SC_Regular",
        }}
      >
        {props.message}
      </Text>
    </View>
  )
};

